package data.nanjing.expo.services;

import data.nanjing.expo.models.dao.ActivityTagInfoDao;
import data.nanjing.expo.models.domain.ActivityTagInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by zjp on 2018/6/24.
 * QQ：34948062
 * github: https://www.github.com/zjp1029
 * web： http://www.zjp1029.cn
 */
@Service
public class ActivityTagInfoService {

    @Autowired
    private ActivityTagInfoDao activityTagInfoDao;

    public List<ActivityTagInfo> selectHotTagInfoList() {
        return activityTagInfoDao.selectHotTagInfoList();
    }

    //批量添加
    @Transactional
    public void addActivityTagInfo(List<ActivityTagInfo> list) {
        for (ActivityTagInfo activityTagInfo : list) {
            activityTagInfoDao.addActivityTagInfo(activityTagInfo);
        }
    }

    public void deleteActivityTagByActivityId(Integer activityId) {
        activityTagInfoDao.deleteActivityTagByActivityId(activityId);
    }

}
